import {Input, InputNumber } from 'antd'

export const TypeInput = ({type, value, onChange, min, max, onBlur}) => {
  const style = {width: '100%'}

  if (type === 'WSTRING') {
    return <Input value={value} onChange={(e) => {
      onChange(e.target.value)
    }} onBlur={onBlur} style={style} placeholder='请输入' autoComplete='off'/>
  }

  return <InputNumber stringMode controls={false} min={min} max={max} value={value} onChange={onChange} style={style}  placeholder='请输入' onBlur={onBlur}/>
}

export default TypeInput